<!DOCTYPE html>
<html>
<head>
    <meta name="layout" content="main"/>
    <g:set var="entityName" value="${message(code: 'contact.label', default: 'Contact')}"/>
    <title>人员关系预警</title>
    <style>
    .table>tbody>tr>td{
        vertical-align: middle;
    }
    @media screen and (min-width:1900px) and (max-width:1920px) {
        .flex{
            display: flex;justify-content: center;align-items: center;
        }
    }
    .select2-container .select2-choices .select2-search-field input,.select2-container .select2-choice,.select2-container .select2-choices{
        color: #999;
    }
    .allInputRadio{
        width: 108px;
        float: left;
        margin-top: 5px;
    }
    </style>
</head>

<body class="fixed-navbar fixed-sidebar">

<div class="small-header">
    <div class="hpanel">
        <div class="panel-body">
            <div id="hbreadcrumb" class="pull-right navFloatRight">
                <ol class="hbreadcrumb breadcrumb">
                    <li>
                        <span>CINDTATA PLS</span>
                    </li>
                    <li class="active">
                        <span>人员关系</span>
                    </li>
                </ol>
            </div>
            <h2 class="font-light m-b-xs">
                人员关系预警
            </h2>
        </div>
    </div>
</div>

<div class="content animate-panel">
    <div class="row">
        <g:form method="POST" action="contactRelationsWarning" class="form-horizontal" role="form" id="form">
            <div class="hpanel hblue">
                <div class="panel-heading">
                    <div class="panel-tools">
                        <button class="btn btn-primary btn-xs" type="submit" onclick="text()"><i class="fa fa-search"></i> 查询</button>
                        <button class="btn btn-warning2 btn-xs" type="button" id="resetBtn">
                            <i class="fa fa-times"></i> 重置</button>
                    </div>
                    查询
                </div>
                <div class="panel-body seach-group" id="bug1">
                    <div class="row">
                        <div class="form-group col-sm-3">
                            <label class="col-sm-3 control-label">借款人姓名</label>
                            <div class="col-sm-9">
                                <input type="text" class="form-control" name="fullName" id="fullName" value="${params?.fullName}" placeholder="请输入借款人姓名">
                            </div>
                    </div>
                    <div class="form-group col-sm-3">
                        <label class="col-sm-3 control-label">证件类型</label>
                        <div class="col-sm-9 input-group" style="display: flex;justify-content: center">
                            <g:select class="form-control" name="identityType" id="identityType"
                                      optionKey="id" optionValue="name"
                                      from="${com.cindata.dictionary.ContactIdentityType.list()}"
                                      value="${params?.identityType}"
                                      noSelection="${['': '请选择证件类型']}"/>
                        </div>
                    </div>
                    <div class="form-group col-sm-3">
                        <label class="col-sm-3 control-label">证件号码</label>
                        <div class="col-sm-9">
                            <input type="text" class="form-control" name="idNumber" id="idNumber" value="${params?.idNumber}" placeholder="请输入证件号码">
                        </div>
                    </div>
                    <div class="form-group col-sm-3">
                        <label class="col-sm-3 control-label">性别</label>
                        <div class="col-sm-9 input-group" style="display: flex;justify-content: center">
                            <g:select class="form-control" name="sex" id="sex" from="${['男','女']}" value="${params?.sex}" noSelection="${['': '请选择性别']}"/>
                        </div>
                    </div>
                </div>

                <div class="row">
                    <div class="form-group col-sm-3">
                        <label class="col-sm-3 control-label">户口性质</label>
                        <div class="col-sm-9 input-group" style="display: flex;justify-content: center">
                            <g:select class="form-control" name="householdType" id="householdType"
                                      from="${['农业户口','非农业户口']}"
                                      valueMessagePrefix="status"
                                      value="${params?.householdType}"
                                      noSelection="${['': '请选择户口性质']}"/>
                        </div>
                    </div>
                    <div class="form-group col-sm-3">
                            <label class="col-sm-3 control-label">学历</label>
                        <div class="col-sm-9 input-group" style="display: flex;justify-content: center">
                            <g:select class="form-control" name="degree" id="degree" from="${['小学','初中','高中','大专','本科','硕士研究生','博士研究生']}" value="${params?.degree}" noSelection="${['': '请选择学历']}"/>
                        </div>
                    </div>
                </div>
            </div>
        </g:form>
    </div>
    </div>

    <div class="row">
        <div class="hpanel hgreen">
            <div class="panel-heading">
                <div class="panel-tools">
                  %{--<a class="btn btn-primary btn-xs" type="submit" href="/riskWarning/releasePriceFluctuationsWarning"><i class="fa fa-paper-plane"></i> 发布预警</a>--}%
                  %{--<button class="btn btn-warning2 btn-xs" type="submit" onclick="searchMap()"><i class="fa fa-map-marker"></i> 查看地图</button>--}%
                    <a class="showhide"><i class="fa fa-chevron-up"></i></a>
                </div>
                全部人员关系列表
            </div>

            <div class="panel-body no-padding">
                <div class="table-responsive">
                    <table cellpadding="1" cellspacing="1" class="table table-striped table-bordered table-hover text-center" id="esateTable">
                        <thead>
                        <tr>
                            <g:sortableColumn property="fullName" title="借款人姓名" class="text-center" params="${params}"/>
                            <g:sortableColumn property="sex" title="性别" class="text-center" params="${params}"/>
                            <g:sortableColumn property="householdType" title="户口性质" class="text-center" params="${params}"/>
                            <g:sortableColumn property="degree" title="学历" class="text-center" params="${params}"/>
                            <g:sortableColumn property="identityType" title="证件类型" class="text-center" params="${params}"/>
                            <g:sortableColumn property="idNumber" title="证件号码" class="text-center" params="${params}"/>
                            <g:sortableColumn property="creditScore" title="个人信用评分" class="text-center" params="${params}"/>
                            <g:sortableColumn property="householdAddress" title="企业评分" class="text-center" params="${params}"/>
                            <th class="col-md-1 text-center sortable" style="color: #34495e;" colspan="2">操作项</th>
                        </tr>
                        </thead>
                        <tbody>
                        %{--<g:each in="${contactList}">--}%
                            <tr>
                                <td class="nameFormat"><g:link style="color: #3498DB" action="contactRelationsWarningShow" class="firstTd" id="张三儿">张三儿</g:link></td>
                                <td>男</td>
                                <td>非农业户口</td>
                                <td>本科</td>
                                <td>身份证</td>
                                <td>100***</td>
                                <td></td>
                                <td></td>
                                <td class="text-center">
                                    <div style="margin-bottom: 2px;">
                                        <a href="#" class="btn btn-xs btn-outline btn-success handleButton">
                                            已处置
                                        </a>
                                    </div>
                                </td>
                                <td class="text-center">
                                    <a href="#" class="btn btn-xs btn-outline btn-danger deleteButton" style="width: 52px; margin-top: 2px;">
                                        删除
                                    </a>
                                </td>
                            </tr>
                            <tr>
                                <td class="nameFormat"><g:link style="color: #3498DB" action="contactRelationsWarningShow" class="firstTd" id="李四儿">李四儿</g:link></td>
                                <td>女</td>
                                <td>农业户口</td>
                                <td>硕士</td>
                                <td>身份证</td>
                                <td>100***</td>
                                <td></td>
                                <td></td>
                                <td class="text-center">
                                    <div style="margin-bottom: 2px;">
                                        <a href="#" class="btn btn-xs btn-outline btn-success handleButton">
                                            已处置
                                        </a>
                                    </div>
                                </td>
                                <td class="text-center">
                                    <a href="#" class="btn btn-xs btn-outline btn-danger deleteButton" style="width: 52px; margin-top: 2px;">
                                        删除
                                    </a>
                                </td>
                            </tr>
                            <tr>
                                <td class="nameFormat"><g:link style="color: #3498DB" action="contactRelationsWarningShow" class="firstTd" id="王富贵">王富贵</g:link></td>
                                <td>男</td>
                                <td>非农业户口</td>
                                <td>博士</td>
                                <td>身份证</td>
                                <td>100***</td>
                                <td></td>
                                <td></td>
                                <td class="text-center">
                                    <div style="margin-bottom: 2px;">
                                        <a href="#" class="btn btn-xs btn-outline btn-success handleButton">
                                            已处置
                                        </a>
                                    </div>
                                </td>
                                <td class="text-center">
                                    <a href="#" class="btn btn-xs btn-outline btn-danger deleteButton" style="width: 52px; margin-top: 2px;">
                                        删除
                                    </a>
                                </td>
                            </tr>
                            <tr>
                                <td class="nameFormat"><g:link style="color: #3498DB" action="contactRelationsWarningShow" class="firstTd" id="王就">王就</g:link></td>
                                <td>男</td>
                                <td>非农业户口</td>
                                <td>大专</td>
                                <td>身份证</td>
                                <td>100***</td>
                                <td></td>
                                <td></td>
                                <td class="text-center">
                                    <div style="margin-bottom: 2px;">
                                        <a href="#" class="btn btn-xs btn-outline btn-success handleButton">
                                            已处置
                                        </a>
                                    </div>
                                </td>
                                <td class="text-center">
                                    <a href="#" class="btn btn-xs btn-outline btn-danger deleteButton" style="width: 52px; margin-top: 2px;">
                                        删除
                                    </a>
                                </td>
                            </tr>
                            <tr>
                                <td class="nameFormat"><g:link style="color: #3498DB" action="contactRelationsWarningShow" class="firstTd" id="冯田林">冯田林</g:link></td>
                                <td>男</td>
                                <td>非农业户口</td>
                                <td>高中</td>
                                <td>身份证</td>
                                <td>100***</td>
                                <td></td>
                                <td></td>
                                <td class="text-center">
                                    <div style="margin-bottom: 2px;">
                                        <a href="#" class="btn btn-xs btn-outline btn-success handleButton">
                                            已处置
                                        </a>
                                    </div>
                                </td>
                                <td class="text-center">
                                    <a href="#" class="btn btn-xs btn-outline btn-danger deleteButton" style="width: 52px; margin-top: 2px;">
                                        删除
                                    </a>
                                </td>
                            </tr>
                            <tr>
                                <td class="nameFormat"><g:link style="color: #3498DB" action="contactRelationsWarningShow" class="firstTd" id="马青天">马青天</g:link></td>
                                <td>女</td>
                                <td>农业户口</td>
                                <td>初中</td>
                                <td>身份证</td>
                                <td>100***</td>
                                <td></td>
                                <td></td>
                                <td class="text-center">
                                    <div style="margin-bottom: 2px;">
                                        <a href="#" class="btn btn-xs btn-outline btn-success handleButton">
                                            已处置
                                        </a>
                                    </div>
                                </td>
                                <td class="text-center">
                                    <a href="#" class="btn btn-xs btn-outline btn-danger deleteButton" style="width: 52px; margin-top: 2px;">
                                        删除
                                    </a>
                                </td>
                            </tr>
                            <tr>
                                <td class="nameFormat"><g:link style="color: #3498DB" action="contactRelationsWarningShow" class="firstTd" id="张一诺">张一诺</g:link></td>
                                <td>女</td>
                                <td>非农业户口</td>
                                <td>大专</td>
                                <td>身份证</td>
                                <td>100***</td>
                                <td></td>
                                <td></td>
                                <td class="text-center">
                                    <div style="margin-bottom: 2px;">
                                        <a href="#" class="btn btn-xs btn-outline btn-success handleButton">
                                            已处置
                                        </a>
                                    </div>
                                </td>
                                <td class="text-center">
                                    <a href="#" class="btn btn-xs btn-outline btn-danger deleteButton" style="width: 52px; margin-top: 2px;">
                                        删除
                                    </a>
                                </td>
                            </tr>
                            <tr>
                                <td class="nameFormat"><g:link style="color: #3498DB" action="contactRelationsWarningShow" class="firstTd" id="陈碧池">陈碧池</g:link></td>
                                <td>女</td>
                                <td>非农业户口</td>
                                <td>本科</td>
                                <td>身份证</td>
                                <td>100***</td>
                                <td></td>
                                <td></td>
                                <td class="text-center">
                                    <div style="margin-bottom: 2px;">
                                        <a href="#" class="btn btn-xs btn-outline btn-success handleButton">
                                            已处置
                                        </a>
                                    </div>
                                </td>
                                <td class="text-center">
                                    <a href="#" class="btn btn-xs btn-outline btn-danger deleteButton" style="width: 52px; margin-top: 2px;">
                                        删除
                                    </a>
                                </td>
                            </tr>
                        %{--</g:each>--}%
                        </tbody>
                    </table>
                </div>
            </div>

            <div class="panel-footer">
                <div class="pagination">
                    %{--<g:paginate action="contactRiskWarning" total="${contactCount ?: 0}" params="${params}"/>--}%
                </div>

            </div>
        </div>
    </div>
</div>



<g:javascript>
    $(".handleButton").click(function(event){
        event.preventDefault();
        var id = $(this).attr("href");
        swal({
            title: "该借款人已经完成预警处置吗？",
            type: "warning",
            showCancelButton: true,
            confirmButtonColor: "#DD6B55",
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            closeOnConfirm: true
        },
                function(){
                    $.ajax({
                        url:'',
                        data:{
                            id:id
                        },
                        type:"post",
                        success:function(data)
                        {
                            // if(data.status=="success"){
                            //     window.location.href="/riskWarning/dealIndex"
                            // }else{
                            //     swal("已处置失败，请稍后重试", "", "error");
                            // }
                        }
                    })

                });
    });
    $(".deleteButton").click(function(event){
        event.preventDefault();
        var id = $(this).attr("href");
//        var $this = $(this);
        swal({
            title: "确定删除该借款人的预警处置吗？",
            type: "warning",
            showCancelButton: true,
            confirmButtonColor: "#DD6B55",
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            closeOnConfirm: true
        },
                function(){
                    $.ajax({
                        url:'',
                        data:{
                            id:id
                        },
                        type:"post",
                        success:function(data)
                        {
//                             if(data.status=="success"){
//                                 $("#searchBtn").click();
// //                            window.location.reload();//刷新页面
// //                            var link = $this.parents("tr");
// //                            link.remove();//删除行
//                             }else{
//                                 swal("删除失败，请稍后重试", "", "error");
//                             }
                        }
                    })
                })
    });
    //重置按钮
    $("#resetBtn").click(function () {
        $("#s2id_city span:first").html("请选择城市");
        $("#city").val("");
        $("#s2id_identityType span:first").html("请选择证件类型");
        $("#identityType").val("");
        $("#fullName").val("");
        $("#s2id_householdType span:first").html("请选择户口性质");
        $("#householdType").val("");
        $("#idNumber").val("");
        $("#s2id_birthdayStart span:first").html("请输入出生年月上限");
        $("#birthdayStart").val("");
        $("#s2id_birthdayEnd span:first").html("请输入出生年月下限");
        $("#birthdayEnd").val("");
        $("#s2id_sex span:first").html("请选择性别");
        $("#sex").val("");
        $("#s2id_degree span:first").html("请选择学历");
        $("#degree").val("");
        $("#cellphone").val("");
        $("#address").val("");
        $("#debitCardNumber").val("");
        $("#creditScoreStart").val("");
        $("#creditScoreEnd").val("");
        $("#s2id_creditRiskLevel span:first").html("请选择潜在风险");
        $("#creditRiskLevel").val("");

    });
</g:javascript>

</body>
</html>
